import service from "@/utils/request.ts";
import {COMPLETE_PRE} from '@/api/port-info.ts'

/**
 * 登录接口
 * @param params 参数
 */
export async function loginReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/login',
        method: 'POST',
        data: params
    });
}

/**
 * 注册接口
 * @param params 参数
 */
export async function registerReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/register',
        method: 'POST',
        data: params
    });
}

/**
 * 忘记密码接口
 * @param params 参数
 */
export async function forgetReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/forgetUpdate',
        method: 'POST',
        data: params
    });
}

/**
 * 发送邮箱验证码
 * @param params 参数
 */
export async function passwordEmailReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/passwordEmail',
        method: 'POST',
        data: params
    });
}

/**
 * 退出登录
 * @param params 参数
 */
export async function logOutReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/logOut',
        method: 'POST',
        data: params
    });
}

/**
 * 用户更新密码
 * @param params 参数
 */
export async function userUpdatePasswordReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'login/userOperate/userUpdatePassword',
        method: 'POST',
        data: params
    });
}

